feat: [DEVEX-304] supports new caught up and fell behind events.#6
Merged
YoEight merged 1 commit intokurrent-io:mainfrom May 15, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for new "caught up" and "fell behind" events for subscriptions by updating both the protocol buffers definitions and the corresponding event handling logic in Go. Key changes include:
- Enhancements to protos/streams.proto with detailed definitions for "CaughtUp" and "FellBehind" messages.
- Updates in kurrentdb/subscriptions.go to handle the new event fields.
- Adjustments in kurrentdb/subscription_event.go to reflect the new caught up and fell behind event types.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| protos/streams.proto | Added detailed definitions for CaughtUp and FellBehind messages. |
| kurrentdb/subscriptions.go | Updated event handling logic to populate caught up and fell behind. |
| kurrentdb/subscription_event.go | Updated subscription event types to separate caught up and fell behind. |
Comment on lines
+104
to
+116
| caughtUp = new(CaughtUp) | ||
| caughtUp.Date = wire.GetTimestamp().AsTime() | ||
|
|
||
| if wire.StreamRevision != nil { | ||
| caughtUp.StreamRevision = new(uint64) | ||
| *caughtUp.StreamRevision = uint64(wire.GetStreamRevision()) | ||
| } else { | ||
| caughtUp.Position = new(Position) | ||
| *caughtUp.Position = Position{ | ||
| Commit: wire.GetPosition().CommitPosition, | ||
| Prepare: wire.GetPosition().PreparePosition, | ||
| } | ||
| } |
There was a problem hiding this comment.
The event handling code in the CaughtUp case expects 'stream_revision' and 'position' fields, but the updated proto definition for CaughtUp only includes a 'timestamp' field. Consider aligning the CaughtUp proto message with the client-side expectations or updating the client logic accordingly.
Suggested change
| caughtUp = new(CaughtUp) | |
| caughtUp.Date = wire.GetTimestamp().AsTime() | |
| if wire.StreamRevision != nil { | |
| caughtUp.StreamRevision = new(uint64) | |
| *caughtUp.StreamRevision = uint64(wire.GetStreamRevision()) | |
| } else { | |
| caughtUp.Position = new(Position) | |
| *caughtUp.Position = Position{ | |
| Commit: wire.GetPosition().CommitPosition, | |
| Prepare: wire.GetPosition().PreparePosition, | |
| } | |
| } | |
| caughtUp = &CaughtUp{ | |
| Date: wire.GetTimestamp().AsTime(), |
w1am
approved these changes
Apr 29, 2025
Contributor
|
Related Jira DEVEX-304 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.